import 'package:flutter/material.dart';

import 'index_recommand_item_widget.dart';
import 'index_recommend_data.dart';

class IndexRecommand extends StatelessWidget {
  final List<IndexRecommendItem> datalist;
  const IndexRecommand({super.key, this.datalist = indexRecommendData});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(10.0),
      decoration: const BoxDecoration(color: Color(0x08000000)),
      child: Column(
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: const [
              Text(
                '房屋推荐',
                style:
                    TextStyle(color: Colors.black, fontWeight: FontWeight.w600),
              ),
              Text(
                '更多',
                style: TextStyle(color: Colors.black54),
              ),
            ],
          ),
          const SizedBox(
            height: 8.0,
          ),
          Wrap(
            runSpacing: 10.0,
            spacing: 10.0,
            children: datalist
                .map((item) => IndexRecommandItemWidget(data: item))
                .toList(),
          )
        ],
      ),
    );
  }
}
